package net.comm.group.db;


import java.sql.ResultSet;
import java.sql.SQLException;


import net.comm.group.bean.BaseGdpGbyDsortID;
import net.comm.util.StringUtil;

import org.sakaiproject.db.api.SqlReader;

public class DbGdpGbyDsortIDService implements SqlReader
{

	/**
	 * Read from the result one set of fields to create a Resource.
	 * 
	 * @param result
	 *        The Sql query result.
	 * @return The Resource object.
	 */
	public Object readSqlResultRecord(ResultSet result)
	{
		try
		{
			int  	groupID = result.getInt(1);								//	群组ID
			String  dsort = StringUtil.getValue(result.getString(2));		//	所属板块
			int  	dsortID = result.getInt(3);								//	板块内容ID
			String  dtype = StringUtil.getValue(result.getString(4));		//	点评类型
			int  	dtypeSum = result.getInt(5);							//	点评统计

			// create the Resource from these fields
			return new BaseGdpGbyDsortID( groupID,  dsort,  dsortID, dtype,  dtypeSum );
		}
		catch (SQLException e)
		{
			return null;
		}
		
	}
}
